package com.zhongwang.mms.module.purchase.dao;

import com.zhongwang.mms.gen.entity.POrder;
import com.zhongwang.mms.gen.entity.POrderExample;
import com.zhongwang.mms.module.purchase.model.POrderModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface PurPOrderDao {
    long countByExample(POrderExample example);

    int deleteByExample(POrderExample example);

    int deleteByPrimaryKey(Integer odrId);

    int insert(POrder record);

    int insertSelective(POrder record);

    List<POrder> selectByExample(POrderExample example);

    POrder selectByPrimaryKey(Integer odrId);

    int updateByExampleSelective(@Param("record") POrder record, @Param("example") POrderExample example);

    int updateByExample(@Param("record") POrder record, @Param("example") POrderExample example);

    int updateByPrimaryKeySelective(POrder record);

    int updateByPrimaryKey(POrder record);

    POrder selectById(Integer odrId);

    /**
     *@FunctionName: selectByOdaIds
     *@Description: 根据明细单主键获取主单实体类
     *@Author: 徐一贺
     *@CreateDate: 2020/4/9 19:20
     *@Phone: 18241927380
     *@Param:
     *@Return:
     *@Version:
     */
    List<POrder> selectByOdaIds(String odaIds);

    /**
     *@FunctionName: selectPOrderById
     *@Description: 获取调拨单打印朱丹内容
     *@DesignIdea: 获取调拨单打印朱丹内容
     *@Author: 徐一贺
     *@CreateDate: 2020/5/23 12:37
     *@Phone: 18241927380
     *@Param: [odrId] 主键
     *@Return: [com.zhongwang.mms.module.purchase.model.POrder] 主单内容
     *@Throw:
     *@Version: v 1.0.0
     */
    com.zhongwang.mms.module.purchase.model.POrder selectPOrderById(Integer odrId);

    /**
     *@FunctionName: selectPOrderModelByOdaIds
     *@Description: 根据明细单主键获取主单列表
     *@Author: 徐一贺
     *@CreateDate: 2020/6/9 10:47
     *@Phone: 18241927380
     *@Param: [odaIds]明细单主键
     *@Version: v 1.0.0
     */
    List<POrderModel> selectPOrderModelByOdaIds(String odaIds);
}